Obstacle = class('Obstacle', Entity):include(Stateful)

function Obstacle:initialize(x, y, width, height, mode, image, frames)
	Entity.initialize(self)
	self.x = x
	self.y = y
	self.name = "obstacle"
	self.entity_type = "obstacle"
	self.width = width
	self.height = height
	self.br_x = self.x+self.width
	self.br_y = self.y+self.height
	self.img = image
	self.anim = newAnimation(self.img)
	for i = 1, #frames do
		self.anim:addFrame(frames[i].x, frames[i].y, frames[i].width, frames[i].height, frames[i].delay)
	end

	self:gotoState(mode)
end

function Obstacle:setMode(mode)
	self:gotoState(mode)
end

function Obstacle:draw()
	self.anim:draw(self.x, self.y, 0, 1, 1)
end



require'src.obstacle_states.platform'
require'src.obstacle_states.star_box'
require'src.obstacle_states.enemy'
